<template>
  <a-card :bordered="false">
    <div class="table-page-search-wrapper">
      <a-form @keyup.enter.native="searchQuery(addForm)" layout="inline">
        <a-row :gutter="24">
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <a-form-item label="设备名称">
              <me-dict-select-tag v-model="addForm.equipmentId" dictCode="ppgy_ppjzsb,sbmc,id" placeholder="请选择设备名称" />
            </a-form-item>
          </a-col>
          <a-col :xl="6" :lg="7" :md="8" :sm="24">
            <span style="float: left;overflow: hidden;" class="table-page-search-submitButtons">
              <a-button type="primary" @click="searchQuery(addForm)" icon="search">查询</a-button>
              <a-button type="primary" @click="searchReset" icon="reload" style="margin-left: 8px">重置</a-button>
              <!-- <a @click="handleToggleSearch" style="margin-left: 8px">
                {{ toggleSearchStatus ? '收起' : '展开' }}
                <a-icon :type="toggleSearchStatus ? 'up' : 'down'"/>
              </a> -->
            </span>
          </a-col>
        </a-row>
      </a-form>
    </div>
    <a-row type="flex" justify="space-around" align="middle">
      <a-col :xl="24" :lg="24" :md="24" :sm="24">
        <div>
          <img src="~@/assets/jiazhu.png" class="jzimg">
        </div>
      </a-col>
    </a-row>
  </a-card>
</template>

<script>
// import myline from './myline.vue'
import { myGetAction,getAction,getActions,searchList } from '@/api/manage'

export default {
  // components:{
  //   myline
  // },
  data() {
    return {
      addForm:{id:null},
      level:[],
      fillingSpeed:[],
      fillingMotorFreq:[],
      fillingMotorStatus:[],
      agitatorMotorStatus:[],
      fillingPressure:[],
      newdata:{}
    }
  },
  created(){
    console.log(this.$route);
    console.log(this.$route.query.ppjzsbId)
    if(this.$route.query.ppjzsbId==undefined){
      this.addForm.id=''
    }else{
      this.addForm.id=this.$route.query.ppjzsbIdid
    }
    this.searchQuery()
  },
  methods: {
    searchQuery(){
      console.log('1212124141')
      console.log(this.addForm.id);
      // getAction("/ppgyPpjzztsj/ppgyPpjzztsj/queryBySId", this.addForm.id).then(res => {
      //   console.log(res)
      //   // if (res.result.length===0){
      //   //   console.log('暂无数据')
      //   //   this.$message.info('暂无数据')
      //   // }
      // })
      // .finally(() => {
      //   console.log("wwwwww");
      // })
      // var ss = setInterval(()=>{
      //   searchList("/znjzfstatus/znjzFillingStatus/queryByEId", this.addForm.equipmentId).then(res => {
      //     console.log(res)
      //     if (res.result.length===0){
      //       console.log('暂无数据')
      //       this.$message.info('暂无数据')
      //     }else{
      //       res.result.map((item,index)=>{
      //         this.level.push({'value':item.liquidlevel,'time':item.time})
      //         this.fillingSpeed.push({'value':item.fillingSpeed,'time':item.time})
      //         this.fillingMotorFreq.push({'value':item.fillingMotorFreq,'time':item.time})
      //         this.fillingMotorStatus.push({'value':item.fillingMotorStatus,'time':item.time})
      //       this.agitatorMotorStatus.push({'value':item.agitatorMotorStatus,'time':item.time})
      //         this.fillingPressure.push({'value':item.fillingPressure,'time':item.time})
      //       })
      //       this.newdata=res.result[res.result.length-1]
      //     }
      //     console.log(res)
      //     console.log(this.level)
      //     console.log(this.newdata)
      //     // this.totles = this.formatGpData(res.result)
      //     if(this.$route.path !== '/znjzstatus'){
      //       clearInterval(ss)
      //     }
      //   })
      // },30000)
      this.level=[
        {time:"2021-12-14 18:25:01",value:"1"},
        {time:"2021-12-14 18:25:02",value:"1"},
        {time:"2021-12-14 18:25:03",value:"1"},
        {time:"2021-12-14 18:25:04",value:"1"},
        {time:"2021-12-14 18:25:05",value:"0"},
        {time:"2021-12-14 18:25:06",value:"1"},
        {time:"2021-12-14 18:25:07",value:"1"}
      ],
      this.fillingMotorFreq=[
        {time:"2021-12-14 18:25:01",value:"2.4"},
        {time:"2021-12-14 18:25:02",value:"2.4"},
        {time:"2021-12-14 18:25:03",value:"2.4"},
        {time:"2021-12-14 18:25:04",value:"2.4"},
        {time:"2021-12-14 18:25:05",value:"0"},
        {time:"2021-12-14 18:25:06",value:"2.4"},
        {time:"2021-12-14 18:25:07",value:"2.4"}
      ],
      this.fillingMotorStatus=[
        {time:"2021-12-14 18:25:01",value:"30"},
        {time:"2021-12-14 18:25:02",value:"30"},
        {time:"2021-12-14 18:25:03",value:"30"},
        {time:"2021-12-14 18:25:04",value:"30"},
        {time:"2021-12-14 18:25:05",value:"0"},
        {time:"2021-12-14 18:25:06",value:"30"},
        {time:"2021-12-14 18:25:07",value:"30"}
      ],
      this.agitatorMotorStatus=[
        {time:"2021-12-14 18:25:01",value:"30"},
        {time:"2021-12-14 18:25:02",value:"30"},
        {time:"2021-12-14 18:25:03",value:"30"},
        {time:"2021-12-14 18:25:04",value:"30"},
        {time:"2021-12-14 18:25:05",value:"0"},
        {time:"2021-12-14 18:25:06",value:"30"},
        {time:"2021-12-14 18:25:07",value:"30"}
      ]
    },
    searchReset(){
      console.log('qwfiuaiu')
      this.addForm.id=''
      this.searchQuery()
    }
  }
}
</script>

<style>
.height-100{
  height:277px;
  /* line-height: 100px; */
}
.jzimg{
  background-size: cover;
  height: 100%;
  width: 100%;
  padding:0px 5px;
}
.height-130{
  height: 450px;
  overflow-y: scroll;
}
</style>